feat: added hierarchical configuration options#152
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a hierarchical configuration system that centralizes all configuration loading through a single entry point. The system prioritizes environment variables over YAML configuration files, ensuring consistent configuration management across the infrastructure.
Key changes:
- Restructured configuration architecture with Pydantic models for type safety and validation
- Replaced scattered environment variable access with a unified CONFIG object
- Added comprehensive YAML configuration support with environment variable overrides
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| nilai-api/src/nilai_api/config/init.py | Complete rewrite to implement hierarchical configuration with Pydantic models |
| nilai-api/src/nilai_api/config/utils.py | New utility functions for YAML loading and configuration model creation |
| nilai-api/src/nilai_api/config/*.py | New configuration modules for different system components |
| Multiple test and source files | Updated imports and references to use the new CONFIG object |
| .env.ci | Added new NilDB configuration variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
9ba5e48 to
998f787
Compare
blefo
approved these changes
Sep 11, 2025
Member
blefo
left a comment
There was a problem hiding this comment.
Looks good to me! It's a good update for everything related to config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the option to load configurations in a hierarchical way from a single point in the whole infrastructure. In that way, we avoid having multiple places where to load configurations.
Aside from that, the configuration is first loaded from ".env" and then if not present from "config.yaml". All the configuration values can come from both places.